use locale independent string for gopal tracklog.
authortsteven4 <tsteven4@gmail.com>
Mon, 13 Nov 2017 22:43:12 +0000 (15:43 -0700)
committertsteven4 <tsteven4@gmail.com>
Mon, 13 Nov 2017 22:43:12 +0000 (15:43 -0700)
gopal.cc
reference/gopal-11-gpx.gpx

index 8438342b15a3676f709b88cf41e45a274bb7bece..ff5f9b2b3d25d1a696b78cbc6c54fddb561e717e 100644 (file)
--- a/gopal.cc
+++ b/gopal.cc
@@ -57,6 +57,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <cmath>
+#include <QtCore/QDateTime>
+#include <QtCore/QString>
 #define MYNAME "gopal"
 
 static gbfile* fin, *fout;
@@ -64,7 +66,6 @@ static gbfile* fin, *fout;
 static struct tm tm,filenamedate, trackdate;
 time_t         tx;
 char tmp[64];
-char routename[64];
 static char* optdate=NULL;
 static char* optmaxspeed=NULL;
 static char* optminspeed=NULL;
@@ -179,10 +180,15 @@ gopal_read()
   char tbuffer[64];
   struct tm tm2;
   lat_old=0;
-  strftime(routename,sizeof(routename),"Tracklog %c",gmtime(&tx));
+  
 
   route = route_head_alloc();
-  route->rte_name = routename;
+  QDateTime qtx;
+  qtx.setTimeSpec(Qt::UTC);
+  qtx.setTime_t(tx);
+  route->rte_name = "Tracklog ";
+  route->rte_name += qtx.toString(Qt::ISODate);
+
   route_add_head(route);
 
   line=0;
index 4e305e9d84c0a0f5a7341492e5b622c0d07b94cc..e6bd15b4a8c2d97326c572abeb624e8af181da26 100644 (file)
@@ -73,7 +73,7 @@
     <hdop>0.766000</hdop>
   </wpt>
   <rte>
-    <name>Tracklog Thu Jan  1 00:00:00 1970</name>
+    <name>Tracklog 1970-01-01T00:00:00Z</name>
     <rtept lat="50.307048000" lon="8.232662000">
       <ele>341.950000</ele>
       <time>2009-11-06T21:32:32.529Z</time>